package com.wanxi.product.service.api.feign;

import com.wanxi.product.service.api.result.CommonResult;
import com.wanxi.product.service.api.vo.enterprise.TypeAddInVo;
import com.wanxi.product.service.api.vo.enterprise.TypeFindAllOutVo;
import com.wanxi.product.service.api.vo.enterprise.TypeUpdateInVo;
import com.wanxi.product.service.api.vo.enterprise.*;
import com.wanxi.product.service.api.query.enterprise.SkuQuery;
import com.wanxi.product.service.api.query.enterprise.SpuQuery;
import com.wanxi.product.service.api.query.admin.TypeQuery;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "product-server")
@RequestMapping("/enterprise")
public interface ProductEnterpriseService {
    /**
     * 添加sku
     * @param skuAddInVo
     * @return
     */
    @PostMapping("/sku/add")
    CommonResult<Long> addSku(@RequestBody SkuAddInVo skuAddInVo);

    /**
     * 获取sku列表
     * @param skuQuery
     * @return
     */
    @GetMapping("/sku/findAll")
    CommonResult<List<SkuFindAllOutVo>> findAllSku(@RequestBody SkuQuery skuQuery);

    /**
     * 根据id查找sku
     * @param id
     * @return
     */
    @GetMapping("/sku/findById")
    CommonResult<SkuFindByIdOutVo> findSkuById(@RequestParam(name = "id") Long id);

    /**
     * 修改sku
     * @param skuUpdateInVo
     * @return
     */
    @PutMapping("/sku/update")
    CommonResult updateSku(@RequestBody SkuUpdateInVo skuUpdateInVo);

    /**
     * 删除sku
     * @param id
     * @return
     */
    @PutMapping("/sku/delete")
    CommonResult deleteSkuById(@RequestParam(name = "id") Long id);

    /**
     * 添加spu
     * @param spuAddInVo
     * @return
     */
    @PostMapping("/spu/add")
    CommonResult<Long> addSpu(@RequestBody SpuAddInVo spuAddInVo);

    /**
     * 查找当前商家管理所有的SPU
     * @param spuQuery
     * @return
     */
    @GetMapping("/spu/findAll")
    CommonResult<List<SpuFindAllOutVo>> findAllSpu(@RequestBody SpuQuery spuQuery);

    /**
     * 根据id查询当前商家下SPU信息
     * @param spuFindByIdInVo
     * @return
     */
    @GetMapping("/spu/findById")
    CommonResult<SpuFindByIdOutVo> findSpuById(@RequestBody SpuFindByIdInVo spuFindByIdInVo);

    /**
     * 修改spu
     * @param spuUpdateInVo
     * @return
     */
    @PutMapping("/spu/update")
    CommonResult updateSpu(@RequestBody SpuUpdateInVo spuUpdateInVo);

    /**
     * 删除spu
     * @param spuDeleteInVo
     * @return
     */
    @PutMapping("/spu/delete")
    CommonResult deleteSpu(@RequestBody SpuDeleteInVo spuDeleteInVo);

    /**
     * 添加分类
     * @param typeAddInVo
     * @return
     */
    @PostMapping("/type/add")
    CommonResult<Long> addType(@RequestBody TypeAddInVo typeAddInVo);

    /**
     * 获取分类列表
     * @param typeQuery
     * @return
     */
    @GetMapping("/type/findAll")
    CommonResult<List<TypeFindAllOutVo>> findAllType(@RequestBody TypeQuery typeQuery);

    /**
     * 根据id查询分类
     * @param id
     * @return
     */
    @GetMapping("/type/findById")
    CommonResult<TypeFindByIdOutVo> findTypeById(@RequestParam(name = "id") Long id);

    /**
     * 修改分类
     * @param typeUpdateInVo
     * @return
     */
    @PutMapping("/type/update")
    CommonResult updateType(@RequestBody TypeUpdateInVo typeUpdateInVo);

    /**
     * 删除分类
     * @param id
     * @return
     */
    @PutMapping("/type/delete")
    CommonResult deleteTypeById(@RequestParam(name = "id") Long id);
}
